package cn.whx.hrm.feign;

import cn.whx.hrm.domain.LoginUser;
import cn.whx.hrm.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class LoginUserFallbackFactory implements FallbackFactory<LoginUserFeignClient> {
    @Override
    public LoginUserFeignClient create(Throwable cause) {
        return new LoginUserFeignClient() {
            @Override
            public AjaxResult addOrUpdate(LoginUser loginUser) {
                return  AjaxResult.me().setSuccess(false);
            }
        };
    }
}
